//index.js
const app = getApp()

const Api = require("../../utils/api.js").API
const Store = require("../../utils/store.js").store
const codeZ = require("../../utils/util.js")
// const QRCode = require("../../utils/weapp-qrcode.js")
Page({
   
  data: {
    goods:[],
    showMore:false,
    codePic:'',
    addrDict:{},
    addrZiti:''
   
  },
  onLoad(){
        
  },
  onShow(){ 
      let that = this;
       const eventChannel = this.getOpenerEventChannel()          
        eventChannel.on('acceptGoods', function(data) {   
        console.log(data);
         
          that.setData({
              goods:data.goods,       
          })                
          // new QRCode('myQrcode',{
          //   text:data.goods.ckOrderNo,
          //   width: 120,
          //   height: 120,
          //   padding: 12, // 生成二维码四周自动留边宽度，不传入默认为0
          //   correctLevel: QRCode.CorrectLevel.Q, // 二维码可辨识度
          //   callback: (res) => {
          //   }
          // })
         
          // Api.orderAddrApi({'orderNo':data.goods.orderNo}).then(res=>{
          //     if(res.code == 0){
          //         that.setData({
          //             addrDict:res.data
          //         })
          //     }
            
          // })
                    
                
      })
      
  },
  listToggle: function () {
    this.setData({
      showMore: !this.data.showMore
    })
  },
 
  })